home *** CD-ROM | disk | FTP | other *** search
- #ifndef __PRINTPICTTOJPEG__
- #define __PRINTPICTTOJPEG__
-
- #include <ImageCompression.h>
-
- struct PICTImage {
- PicHandle theData; /*the PICT Data Handle*/
- Rect theBounds; /* the Bounds of the Image */
- ImageDescriptionHandle theDesc; /* an ImageDescriptionHandle */
- };
- typedef struct PICTImage PICTImage;
-
- // macro for determining if the port is a color port.
- #define ISCOLORPORT(gPort) (((gPort)->portBits.rowBytes & 0x8000) != 0)
-
-
- //=====================================================================================
- // Public interface function prototypes
- //=====================================================================================
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- static OSErr ReadPICTData(FSSpec *theSpec, Handle *theData);
-
- static OSErr SetPICTBounds(PICTImage *thePICTImage);
-
- // DrawPICTImage -- draws the PICT image the current port
- static OSErr DrawBitImage(GWorldPtr theGWorld, Rect *bounds, Boolean doCompression);
-
- SInt16 main(void);
- static SInt16 initMacintosh(void);
- static OSErr SetupMenus(void);
- static SInt16 handleEvent(void);
-
- static OSErr Print(PICTImage thePICTImage, THPrint aPrintRecordHandle);
-
- static void DoKeyDown(EventRecord *);
- static void doCommand(SInt16,SInt16);
- static void showAboutMeDialog(void) ;
- static void DoTheOpenCommand(void);
-
- #ifdef __cplusplus
- }
- #endif
-
- /*
- * Resource ID constants.
- */
-
-
- #define kAppleMenuID 128 /* This identifies the apple menu*/
- #define kFileMenuID 129
- #define kEditMenuID 130
- #define kImageCompressionMenuID 131
-
- /* Menu item numbers */
- /* Apple Menu */
- #define kAboutMeCommand 1
-
- /* File Menu */
- #define kOpenCommand 1
- #define kSaveCommand 2
- // separator line 3
- #define kPageSetupCommand 4
- #define kPrintCommand 5
- // separator line 6
- #define kQuitCommand 7
-
- /* Compression Settings Menu */
- #define kDoImageCompression 1
-
- /*
- * Support for the About Dialog
- */
- #define kAboutMeDLOG 128
- #define kOKButton 1
-
- // alert dialog ID to report problems to users.
- #define kGenericError 128
-
- // define for flags to StdPix bottleneck.
- #define kCallOldBits (1 << 0)
- #define kCallStdBits (1 << 1)
-
- #define MIN(x,y) ( x > y ) ? y : x
-
- #define kSleepTime 5
-
- #define kInsetBits 40
- #define kWithCompression true
- #define kNoCompression false
- #define kPICTHeaderSize 512
-
- // Application Specific Errors
- #define kAppError 4017
- #define kCouldntLoadMenu 4018
-
- #endif
-